package com.josework.springhelloworld.lambda;

import java.math.BigDecimal;

public class SomeThing {

    // 静态变量
    static int outerStaticNum;
    // 成员变量
    int outerNum;

    void testScope(){

        Converter<Integer,String> stringConverter = (from) -> {
            //对成员变量赋值
            outerNum = 23;
            return String.valueOf(from + outerNum);

        };
        stringConverter.convert(12);

        Converter<Integer,String> stringConverter1 = (from) ->{
            outerStaticNum = 50;
            return String.valueOf(from+ outerStaticNum);
        };
        stringConverter1.convert(25);


    }

    String startsWith(String value){
        return String.valueOf(value.charAt(0));
    }

    public static void main(String[] args) {
//        SomeThing someThing = new SomeThing();
//        Converter<String, Integer> converter = (from) -> Integer.valueOf(from);
//        Integer converted = converter.convert("123");
//
//        Converter<String, Integer> converter2 = Integer::valueOf;
//        Integer integer = converter2.convert("123");
//
//        PersonFactory<Person> personFactory = Person::new;
//        Person person = personFactory.create("Peter", "Parker");
//
//        String s1 = "123456";
//        Long l1 = Long.valueOf(s1);

        SomeThing someThing = new SomeThing();
        someThing.testScope();

    }






}
